package com.yowasa.xiuxian.engine.battle.enemy.mental;


import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.Mental;
import com.yowasa.xiuxian.engine.hone.MentalInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.entity.enums.StageEnum;
import com.yowasa.xiuxian.exception.HandlerException;

import java.util.List;

@Mental(name = "修仙野史")
public class XiuXianYeShi implements MentalInterface {

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void limit(UserBO user) {
    }

    @Override
    public String limitDesc() {
        return "无要求";
    }

    @Override
    public String desc() {
        return "无属性心法,流落在民间的土法修仙方式,给予了凡人晋升之法,并记载了灵气应用之技";
    }

    @Override
    public List<String> bsList() {
        return Lists.newArrayList("杂耍百式");
    }

    @Override
    public String breakUp(UserBO user) {
        UserBattle upBattle = getBaseUp(user);
        upBattle.setMp(upBattle.getMp());
        upBattle.setCmp(upBattle.getMp());
        upBattle.setSpell((int)((upBattle.getSpell() + 5) * 1.2));
        upBattle.setAtk((int)((upBattle.getAtk() + 5) * 1.1));
        upBattle.setImm((int)((upBattle.getImm()+2) * 1.5));
        buildNewUpBattle(user, upBattle);
        return upBattle.getUpDesc();
    }

    public int getExpect(UserBO user) {
        Integer code = user.getStage();
        StageEnum level = StageEnum.getById(code);
        int need = level.getNeed();
        return ((100 - user.getLevel()) * need) * 200 / (user.getUserAttr().getInts() * 1);
    }


    //修炼获取经验
    public int getExp(UserBO user, int days) {
        Integer lingGen = 1;
        int exp = user.getUserAttr().getInts() * days * lingGen / 200;
        return exp;
    }


}
